﻿using Custom.Infrastructure;
using Custom.Model.Dto;
using Custom.Model.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Custom.Service.Repository
{
    public class SysRoleMenuReporitory : DbContext<SysRoleMenu>
    {
        public List<SysMenuDto> GetRoleMenus(int roleId)
        {
            string sql = "select sm.*, srm.ishomepage from sysmenu sm, sysrolemenu srm " +
                         " where sm.id = srm.menuid and sm.isdeleted = 0 and srm.roleid = " + roleId + " " +
                         " order by srm.corder";

            return Db.Ado.SqlQuery<SysMenuDto>(sql);
        }
    }
}
